package com.jvup.gameshow.controller;

import com.google.android.material.appbar.AppBarLayout;
import com.jvup.common.basic.ObjectUtil;
import com.jvup.common.support.base.EventController;
import com.jvup.gameshow.databinding.FragmentMallBinding;
import com.jvup.gameshow.fragment.MallFragment;
import com.scwang.smart.refresh.layout.api.RefreshLayout;

public class MallController extends EventController<MallFragment> {

    public MallController(MallFragment fragment) {
        super(fragment);
    }

    @Override
    protected void bindView() {
        FragmentMallBinding viewDataBinder = owner.viewDataBinder();
        if(ObjectUtil.nonNull(viewDataBinder)) {
            viewDataBinder.setMallController(this);
        }
    }

    public void refreshLayoutOnLoadMore(RefreshLayout refreshLayout) {
    }

    public void refreshLayoutOnRefresh(RefreshLayout refreshLayout) {
    }

    public void appBarOnOffsetChanged(AppBarLayout appBarLayout, int verticalOffset){
        System.out.println("appBarOnOffsetChanged" + verticalOffset);
        if(verticalOffset == 0) {
            //修改状态标记为展开

        } else if(Math.abs(verticalOffset) >= appBarLayout.getTotalScrollRange()) {
            //修改状态标记为折叠

        } else {
            //修改状态标记为中间

        }
    }

}
